package com.wx.demo.mvc.action;

import com.wx.demo.service.IDemoService;
import com.wx.mvcframework.annotation.Controller;
import com.wx.mvcframework.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("/two")
public class TwoAction {

    private IDemoService demoService;

    public void edit(HttpServletRequest req, HttpServletResponse resp,
                     String name) {
        String result = demoService.get(name);
        try {
            resp.getWriter().write(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    @RequestMapping("/t")
    public void qytwo(HttpServletRequest req, HttpServletResponse response) {
        try {
            response.getWriter().write("aaaaaa");
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }

}
